package com.qyhl.webtv.module_live.teletext.mixlive;


import com.qyhl.webtv.commonlib.entity.live.MixListBean;

import java.util.List;

/**
 * Created by qyhl on 2018/1/30.
 */

public class MixLiveListPresenter implements MixLiveListContract.MixLivePresenter {
    private MixLiveListContract.MixLiveView mView;

    private MixLiveListModel mModel;


    public MixLiveListPresenter(MixLiveListContract.MixLiveView mView) {
        this.mView = mView;
        this.mModel = new MixLiveListModel(this);
    }

    @Override
    public void getList(String newsId, String type) {
        mModel.getList(newsId, type);
    }

    @Override
    public void setList(List<MixListBean> beanList, boolean isMore) {
        mView.setList(beanList, isMore);
    }

    @Override
    public void setError(int code, String msg) {
        switch (code) {
            case 0:
                mView.setNetError(msg);
                break;
            case 1:
                mView.showMessage(msg);
                break;
            case 2:
                mView.setEmpty(msg);
                break;
            case 3:
                mView.showLog(msg);
                break;
            case 4:
                mView.setError(msg);
                break;
            case 5:
                mView.showMessage(msg);
                break;
            default:
                break;
        }
    }
}
